import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Login from "../views/Login.vue";
import Register from "../views/Register.vue";
import PersonalIndex from "../views/personal/Index.vue";
import Edit from "../views/personal/Edit.vue";
import Follow from "../views/Follow.vue";
import Test from "../views/Test.vue";
import Collect from "../views/personal/Collect.vue";
import PostDetail from "../views/PostDetail.vue";
import Morecomment from "../views/morecomment.vue";
import Search from "../views/Search.vue";
import MyComments from "../views/personal/MyComments.vue";
import Category from "../views/Category.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
  },
  {
    path: "/personalindex",
    name: "PersonalIndex",
    component: PersonalIndex,
    meta: {
      auth: true,
    },
  },
  {
    path: "/edit",
    name: "Edit",
    component: Edit,
    meta: {
      auth: true,
    },
  },
  {
    path: "/follow",
    name: "Follow",
    component: Follow,
    meta: {
      auth: true,
    },
  },
  {
    path: "/mycomments",
    name: "MyComments",
    component: MyComments,
  },
  {
    path: "/test",
    name: "Test",
    component: Test,
  },
  {
    path: "/collect",
    name: "Collect",
    component: Collect,
  },
  {
    path: "/postDetail/:id",
    name: "PostDetail",
    component: PostDetail,
  },
  {
    path: "/morecomment/:id",
    name: "Morecomment",
    component: Morecomment,
  },
  {
    path: "/search",
    name: "Search",
    component: Search,
  },
  {
    path: "/category",
    name: "Category",
    component: Category,
  },
];

const router = new VueRouter({
  routes,
});

export default router;
